package cn.tworice.blog.dao;

import cn.tworice.blog.entity.BlogEntry;
import cn.tworice.blog.entity.CountIp;
import cn.tworice.blog.entity.ErrorInfo;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface BlogDao {

    int insertBlogEntry(BlogEntry blogEntry);

    int updateBlogEntry(BlogEntry blogEntry);

    List<BlogEntry> queryEntryList();

    int isLogin(String password);

    int delEntryById(Integer id);

    int delEntryByIds(List<Integer> ids);

    List<ErrorInfo> queryErrorInfo(Long startTime, Long endTime);

    List<CountIp> queryUserInfo();

    // 通过时间 获取访问的IP
    List<Map> queryIpSumByTime(long startTime, long endTime);

    int queryErrorSumByTime(long startTime, long endTime);

    List<Map<String, Integer>> queryApiSumError(Long startTime, Long endTime);

    List<Map<String, Integer>> queryIpSumError(Long startTime, long endTime);
}
